ghacks-clear-57-[changes-only].js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* see https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.1-Bulk-Pref-Resetting-[Scratchpad] */
  2. (function() {
  3. let ops = [
  4. /* --- 57-alpha --- */
  5. /* commented out */
  6. 'browser.storageManager.enabled',
  7. 'dom.storageManager.enabled',
  8. /* removed from the user.js */
  9. 'browser.search.geoip.timeout',
  10. 'geo.wifi.xhr.timeout',
  11. 'gfx.layerscope.enabled',
  12. 'media.webspeech.recognition.enable',
  13. /* moved to RFP ALTERNATIVES */
  14. 'dom.w3c_touch_events.enabled',
  15. 'media.video_stats.enabled',
  16. /* moved to DEPRECATED/REMOVED */
  17. 'browser.bookmarks.showRecentlyBookmarked',
  18. 'browser.casting.enabled',
  19. 'devtools.webide.autoinstallFxdtAdapters',
  20. 'media.eme.chromium-api.enabled',
  21. 'social.directories',
  22. 'social.enabled',
  23. 'social.remote-install.enabled',
  24. 'social.share.activationPanelEnabled',
  25. 'social.shareDirectory',
  26. 'social.toast-notifications.enabled',
  27. 'social.whitelist',
  28. /* reset parrot: check your open about:config after running the script */
  29. '_user.js.parrot'
  30. ]
  31. if("undefined" === typeof(Services)) {
  32. alert("about:config needs to be the active tab!");
  33. return;
  34. }
  35. let c = 0;
  36. for (let i = 0, len = ops.length; i < len; i++) {
  37. if (Services.prefs.prefHasUserValue(ops[i])) {
  38. Services.prefs.clearUserPref(ops[i]);
  39. if (!Services.prefs.prefHasUserValue(ops[i])) {
  40. console.log("reset", ops[i]);
  41. c++;
  42. } else { console.log("failed to reset", ops[i]); }
  43. }
  44. }
  45. focus();
  46. let d = (c==1) ? " pref" : " prefs";
  47. if (c > 0) {
  48. alert("successfully reset " + c + d + "\n\nfor details check the Browser Console (Ctrl+Shift+J)");
  49. } else { alert("nothing to reset"); }
  50. })();